-
搜索结果
-
worker_processes auto;
worker_rlimit_nofile 51200;
events
{
worker_connections 51200;
multi_accept on;
}
http {
include mime.types;
#include luawaf.conf;
include proxy.conf;
default_type application/octet-stream;server_names_hash_bucket_size 512;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 50m;sendfile on;
tcp_nopush on;keepalive_timeout 60;
tcp_nodelay on;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.1;
gzip_comp_level 2;
gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml;
gzip_vary on;
gzip_proxied expired no-cache no-store private auth;
gzip_disable “MSIE [1-6]\.”;limit_conn_zone $binary_remote_addr zone=perip:10m;
limit_conn_zone $server_name zone=perserver:10m;server_tokens off;
access_log off;server {
listen 80;server_name localhost;
#charset koi8-r;
#access_log logs/ho allow 127.0.0.1;
deny all;
stub_status on;
access_log off;
}
}
include vhost/*.conf;
#加载vhost目录下的虚拟主机配置文件
}
st.access.log main;location / {
root html;
index index.html index.htm;
}
location /nginx_status {这是目前nginx.conf的配置,你说残留的 SSL 配置信息我确实找不出来是哪里,拜托请指出,谢谢!
找了半天才算是找到了最合适的伪静态规则文件,有必要贴上来方便以后查阅,服务器是全新配置的,现在终于算是可以正常使用了,以下规则为 WordPress + nginx 服务器的 multisite 多站点模式,伪静态规则和配置;
仅供参考,如有需要请按照你自己的站点具体配置进行域名和路径的修改。
server { listen 80; server_name www.weixiaoduo.com *.weixiaoduo.com access_log /data/wwwlogs/www.weixiaoduo.com_nginx.log combined; index index.html index.htm index.php; root /data/wwwroot/www.weixiaoduo.com; location ~ [^/]\.php(/|$) { #fastcgi_pass remote_php_ip:9000; fastcgi_pass unix:/dev/shm/php-cgi.sock; fastcgi_index index.php; include fastcgi.conf; } location / { index index.php; try_files $uri $uri/ /index.php?$args; } # Add trailing slash to */wp-admin requests. rewrite /wp-admin$ $scheme://$host$uri/ permanent; # Directives to send expires headers and turn off 404 error logging. location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { expires 24h; log_not_found off; } # this prevents hidden files (beginning with a period) from being served location ~ /\. { access_log off; log_not_found off; deny all; } # Pass uploaded files to wp-includes/ms-files.php. rewrite /files/$ /index.php last; if ($uri !~ wp-content/plugins) { rewrite /files/(.+)$ /wp-includes/ms-files.php?file=$1 last; } # Rewrite multisite '.../wp-.*' and '.../*.php'. if (!-e $request_filename) { rewrite ^/[_0-9a-zA-Z-]+(/wp-.*) $1 last; rewrite ^/[_0-9a-zA-Z-]+.*(/wp-admin/.*\.php)$ $1 last; rewrite ^/[_0-9a-zA-Z-]+(/.*\.php)$ $1 last; } }
真是快被WordPress 多站点头像的问题折腾疯了,好在解决了。
这里说下解决方案:
头像互通,数据互通,另外用户资料也要互通,采用的插件是 Ultimate Member,
我们改了 WordPress 的自定义上传路径,但是出现了比较恼火的问题,头像无法上传,反复测试最后发现是文件夹权限有问题,换了种方式,调整了下官方可以上传了,但是有出现了个问题,数据没法共享到其他站点。
特别是我们论坛,无法上传头像,让人看上去真心不爽,都不知道是谁回复的谁。
因为启用的是子域名,所以服务器需要开启
CORS是跨域资源共享 ,添加后,果然,可以上传了。
但是论坛还是没有显示出来,接下来,
检查了下我们添加此上传自定义路径问题,发现会重新生成一个重复的目录,这样调用不到原来上传的头像,想了想还是路径不对,改了配置文件,发现也不对,最后想了下,有可能的就是 functions.php 文件里面添加的自定义配置代码不对,
Google 找了下发现了以下代码,添加替换掉原来的,哈,成了!
//添加多站点媒体库上传文件地址自定义功能 add_filter( 'upload_dir', 'upload_dir_filter' ); function upload_dir_filter( $upload ) { $dir = $_SERVER['DOCUMENT_ROOT']; $upload_dir = $dir['basedir'] . '/uploads/date'; $upload_url = $dir['baseurl'] . '/uploads/date'; wp_mkdir_p( $upload_dir ); //WordPress will check if the dir exists and can write to it. $upload['path'] = $upload_dir; $upload['url'] = $upload_url; return $upload; }
仅以此文纪念这一个多月的苦恼,无助,。
未找到对应子版块?请直接在 [疑难杂症] 版块中发帖提问。